<!DOCTYPE html>
<!--解决idea thymeleaf 表达式模板报红波浪线-->
<!--suppress ALL -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <!-- 引入公用部分 -->
    <script th:replace="head::static"></script>
    <!-- 样式 -->
    <link th:href="@{/css/agent/agent.css}" rel="stylesheet" type="text/css"/>
</head>
<body>

                <form id="agentForm" class="layui-form layui-form-pane">
                    <div class="layui-form-item">
                        <label class="layui-form-label">代理商</label>
                        <div class="layui-input-inline">
                            <input type="text" name="agentName" th:value="${agent.agentName}" 
                            		autocomplete="off" placeholder="用户名"
                                   	class="layui-input">
                        </div>
                         <label class="layui-form-label">登录账号</label>
                        <div class="layui-input-inline">
                            <input type="text" name="loginName" th:value="${agent.loginName}"
                            		autocomplete="off" placeholder="联系电话"
                                   	class="layui-input" readonly="readonly">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">联系人</label>
                        <div class="layui-input-inline">
                            <input type="text" name="agentPerson" th:value="${agent.agentPerson}"
                            		autocomplete="off" placeholder="联系人"
                                   	class="layui-input">
                        </div>
                         <label class="layui-form-label">联系电话</label>
                        <div class="layui-input-inline">
                            <input type="text" name="agentPhone" th:value="${agent.agentPhone}"
                            		autocomplete="off" placeholder="联系电话"
                                   	class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">月结（%）</label>
                        <div class="layui-input-inline">
                            <input type="text" name="baseAmountPoint" th:value="${agent.baseAmountPoint}"
                            		autocomplete="off" placeholder="输入格式：x.x"
                                   	class="layui-input">
                        </div>
                         <label class="layui-form-label">季结（%）</label>
                        <div class="layui-input-inline">
                            <input type="text" name="stepAmountPoint" th:value="${agent.stepAmountPoint}"
                            		autocomplete="off" placeholder="输入格式：x.x"
                                   	class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">开始代理时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="startDate" th:value="${agent.startDate}"
                                	   autocomplete="off" id="inputStartDate" placeholder="yyyy-MM-dd"
                                       class="layui-input">
                            </div>
                            <label class="layui-form-label">结束代理时间</label>
                            <div class="layui-input-inline">
                                <input type="text" name="endDate" th:value="${agent.endDate}"
                                		autocomplete="off" id="inputEndDate" placeholder="yyyy-MM-dd"
                                       	class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label">开户行名称</label>
                            <div class="layui-input-inline">
                                <input type="text" name="bankName" th:value="${agent.bankName}"
                                       autocomplete="off" placeholder="开户行名称"
                                       class="layui-input">
                            </div>
                            <label class="layui-form-label">银行卡号</label>
                            <div class="layui-input-inline">
                                <input type="text" name="bankCode" th:value="${agent.bankCode}"
                                       autocomplete="off" placeholder="银行卡号"
                                       class="layui-input">
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-label required">代理商类型</label>
                            <div class="layui-input-block layui-form" lay-filter="sellerIdfilter">
                                <select name="agentType" id="agentType">
                                    <option value="0" th:selected="${agent.agentType==0}">个人</option>
                                    <option value="1" th:selected="${agent.agentType==1}">企业</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div id="agentType0">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="personName" th:value="${agent.personName}"
                                           autocomplete="off" placeholder="姓名"
                                           class="layui-input">
                                </div>
                                <label class="layui-form-label">身份证号码</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="personCode" th:value="${agent.personCode}"
                                           autocomplete="off" placeholder="身份证号码"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div id="agentType1">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">公司名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="corporateName" th:value="${agent.corporateName}"
                                           autocomplete="off" placeholder="公司名称"
                                           class="layui-input">
                                </div>
                                <label class="layui-form-label">纳税识别号</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="corporateCode" th:value="${agent.corporateCode}"
                                           autocomplete="off" placeholder="纳税识别号"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <label class="layui-form-label">地址</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="corporateAddress" th:value="${agent.corporateAddress}"
                                           autocomplete="off" placeholder="地址"
                                           class="layui-input">
                                </div>
                                <label class="layui-form-label">公司联系方式</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="corporatePhone" th:value="${agent.corporatePhone}"
                                           autocomplete="off" placeholder="公司联系方式"
                                           class="layui-input">
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">密码</label>
                        <div class="layui-input-block">
                            <a class="layui-btn layui-btn-sm" onclick="resetPassword()">重置密码</a>
                            <div class="layui-form-mid layui-word-aux" style="float: unset; margin-left: 10px;">
                                初始、重置密码：<span th:text="${agent.initPassword}"></span>
                            </div>
                        </div>
                    </div>

                    <!-- 隐藏域 -->
                    <input type="text" name="agentId" th:value="${agent.agentId}" hidden="hidden"/>
                    <input type="text" name="agentAccountId" th:value="${agent.agentAccountId}" hidden="hidden"/>
                    <input type="text" name="loginId" th:value="${agent.loginId}" hidden="hidden"/>
                </form>

                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <a class="layui-btn" onclick="agentFormSave()">保存</a>
                    </div>
                </div>
</body>
<!-- js -->
<script th:src="@{/js/agent/agent.js}"></script>
</html>